﻿using Microsoft.OpenApi.Models;

namespace Cl.WebApi.SwaggerModel
{
    public static class SwaggerInit
    {
        public static string ApiVersion => "1.0.0";
        //_config["ApiVersion"];
        public static string description = "";

        /// <summary>
        /// Swagger分组信息，将进行遍历使用
        /// </summary>
        public static readonly List<SwaggerApiInfo> ApiInfos = new List<SwaggerApiInfo>()
        {
            new SwaggerApiInfo
            {
                UrlPrefix = Grouping.OpenGroup,
                Name = "开放接口",
                OpenApiInfo = new OpenApiInfo
                {
                    Version = ApiVersion,
                    Title = "丛林Plus - 开放接口",
                    Description = description
                }
            },
            new SwaggerApiInfo
            {
                UrlPrefix = Grouping.AdminGroup,
                Name = "后端接口",
                OpenApiInfo = new OpenApiInfo
                {
                    Version = ApiVersion,
                    Title = "丛林Plus - 后端接口",
                    Description = description
                }
            },
            new SwaggerApiInfo
            {
                UrlPrefix = Grouping.ClientGroup,
                Name = "前端接口",
                OpenApiInfo = new OpenApiInfo
                {
                    Version = ApiVersion,
                    Title = "丛林Plus - 前端接口",
                    Description = description
                }
            },
            new SwaggerApiInfo
            {
                UrlPrefix = Grouping.GroupName,
                Name = "JWT授权接口",
                OpenApiInfo = new OpenApiInfo
                {
                    Version = ApiVersion,
                    Title = "丛林Plus - JWT授权接口",
                    Description = description
                }
            }
        };
    }
}
